<template>
  <div>
    <el-table :data="tableData"
              border
              style="width: 100%"
              height="500">
      <el-table-column prop="doctorName"
                       label="医生姓名"
                       align="center">
      </el-table-column>
      <el-table-column prop="amount"
                       label="结算金额（税后）"
                       align="center">
      </el-table-column>
      <el-table-column prop="bankNumber"
                       label="银行卡号"
                       align="center">
      </el-table-column>
      <el-table-column prop="status"
                       label="结算状态"
                       align="center">
        
      </el-table-column>
      <el-table-column prop="income"
                       label="收入来源"
                       align="center">
      </el-table-column>
      <el-table-column prop="tradingTime"
                       label="交易时间"
                       align="center">
      </el-table-column>
    </el-table>
    <el-row type="flex"
            align="middle"
            style="text-align: center"
            @current-change="handleCurrentChange"
            :current-page.sync="pageNum"
            :total="1000">
      <el-col>
        <el-pagination @current-change="getSettle()"
                       :current-page.sync="pageNum"
                       :page-size="pageSize"
                       layout="total, prev, pager, next"
                       :total="total">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: "DepartmentsData",
  data () {
    return {
      pageNum: 1,
      pageSize: 5,
      total: 0,
      tableData: [],
      // 初始化分页参数
      pageparm: {
        currentPage: 1,
        pageSize: 5,
        total: 0,
      },
    }
  },
  //创建完毕
  created() {
    // 获取表单数据
    this.getSettle();
    // this.tableData = localStorage.getItem("successData");
  },
  methods: {
     //获取表单数据
    getSettle(){
        this.$axios.get("/finance/settlement/")
        .then((res) => {
            if(res.data.code == 200){
                console.log(res)
                this.tableData = res.data.data;
                this.pageparm.total = res.data.data.total;
            }else{
                this.$message({type: 'info',message: res.data.message})
            }
        })
        .catch(err => {
            this.$message.error('数据加载失败，请稍后再试！')
        })
    },
    // 分页插件事件
    callFather(parm) {
      this.pageparm.currentPage = parm.currentPage;
      this.pageparm.pageSize = parm.pageSize;
      this.getdata();
    },
  }

}
</script>

<style scoped>
</style>
